<?
class SignIn extends Module
{
	function SignIn($row)
	{
		Module::Module($row);
		
		if(!User::is_login())// && !MINGID_ON)
		{
                        if(Url::get('do') AND Url::get('do')== 'lostpass')
                        {
                            require_once 'forms/lostpass.php';
                            $this->add_form(new LostPassForm);
                        }  else {
                            require_once 'forms/sign_in.php';
                            $this->add_form(new SignInForm);
                        }
			
		}
		else
		{
			$href = Url::get('href');
			$href = base64_decode($href);
			
			if($href)
			{				
				$href = str_replace('SID='.$_COOKIE['PHPSESSID'],'',$href);
				Url::redirect_url($href,array('portal'));
			}
			else{
				Url::redirect('home');
			}			
		}
	}
}
?>